<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>时间函数绑定参数</title>
</head>
<body>
    <pre>
      事件绑定的参数有两种方式
      1. 不需要参数可以直接调用methods中的函数名；
      2. 需要绑定参数可以调用事件绑定的函数在括号内添加参数，注意最后以$event结束
    </pre>
    <div id="app">
        <div v-text="age"></div>
        <button @click="calulate1">点击1</button>
        <button v-on:click="calulate2(123,345,$event)">点击2</button>
    </div>
    <script type="text/javascript" src="./js/vue.js"></script>
    <script type="text/javascript">
    var vm = new Vue({
        el: '#app',
        data: {
            age: 0,
        },
        methods: {
            calulate1 () {
                console.log(event)
            },
            calulate2 (p1,p2,event) {
                console.log(p1,p2)
             console.log(event.target.innerHTML)
             this.num++;
            }
        }
    })
    
    
    
    </script>
    
</body>
</html>